<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />  
    <title>待办事项</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta name="author" content="飞啊飘啊">
	<meta name="hashcode" content="-180079761">
	
	<script>window.duteTag="lz";</script>
	<script type="text/javascript" src="/admin/js/dute-1.0.js"></script>
	<script type="text/javascript" src="/admin/js/jquery-1.7.1.min.js"></script>
	
	<script type="text/javascript" src="/admin/js/lazy3q.ui.js"></script>
	<script>
		document.write('<link rel="stylesheet" type="text/css" href="/admin//css/'+($.cookie('theme')||'elegant')+'/lazy3q.ui.css" /> ');
	</script>
	
	<script type="text/javascript" src="/admin/js/jquery-ui-1.10.2.custom.min.js"></script>
	
	<!-- 用户自定义js(懒加载) -->
	<script type="text/javascript" src="/admin/js/define.js"></script>
	<!-- 用户自定义css样式 -->
	<link rel="stylesheet" type="text/css" href="/admin/css/define.css"/>
	<!-- icon font -->
  	<link rel="stylesheet" href="/admin/css/iconfont.css">
	
	
	
	<script type="text/javascript">
		window.basePath="/";
		window.hashcode = "-180079761";
	</script>
		
	<!-- 感谢kindeditor出品的在线HTML编辑控件 -->
	<script type="text/javascript" charset="utf-8" src="/admin/js/kindeditor/kindeditor.js"></script>
		
	<!-- 感谢My97DatePicker出品的时间控件 -->
	<script language="javascript" type="text/javascript" src="/admin/js/My97DatePicker/WdatePicker.js"></script>
	
	<!------------------------VIEW_HTML_HEAD------------------------>
	<!------------------------VIEW_HTML_HEAD------------------------>	
	
</head>
<script>
Page({
  data:{
    
  },
  onLoad: function(options) {
  	var THIS = this;
  	THIS.setData(options);
  	$.getAjax("todo.get.do",options,function(protocol){
  		if(protocol.message){
  			$.toast(protocol.message);
  		}
  		document.title={
  			 "insert":"创建待办事项"
  			,"inport":"导入待办事项"
  			,"update":"修改待办事项"
  			,"detail":"待办事项详情"
  		}[options.edittype];
  		THIS.setData(protocol.data); 
  		/******************VIEW_HTML_SET_DATA******************/
  		/******************VIEW_HTML_SET_DATA******************/
  	});
  }
});
</script>
<script>
window["lzFlashUrl"]=top.lzFlashUrl||"/admin/flash/";
window["uploadUrl"]=top.uploadUrl||"/admin/upload.do";

$(function(){
		 
	$("#todoForm").form({
		"":function(){}
		,"srvTodo.stId":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvTodo.stTitle":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "待办标题不能为空";
			}
			if(el.value.length>32 && el.value.indexOf("[*]")==-1)
				return "待办标题最大长度为32个字符";
		}
		,"srvTodo.stAlarmTime":function(el){
		}
		,"srvTodo.stUser":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
			}
		}
		,"srvTodo.stContent":function(el){
			if(el.value.length>256 && el.value.indexOf("[*]")==-1)
				return "待办内容最大长度为256个字符";
		}
		,"srvTodo.stUpdateTime":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "修改时间不能为空";
			}
		}
		,"srvTodo.stAddTime":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "添加时间不能为空";
			}
		}
		,"srvTodo.stStatus":function(el){
			if($(el).parents("dd:eq(0)").find("b:contains('*')").size()>0){
				if(jQuery.trim(el.value)=="")
					return "请选择状态";
			}
		}
	},function(){
		/******************************LAZY3Q_FORM_VALIDATE******************************/
		/******************************LAZY3Q_FORM_VALIDATE******************************/
	});		
});
</script>

<body style="display:none;">



<!------------------------VIEW_HTML_TOP------------------------>
<!------------------------VIEW_HTML_TOP------------------------>


<form enctype="{{inports!=null?'multipart/form-data':''}}" lz:if="{{edittype=='insert'||edittype=='update'||edittype=='detail'||edittype=='any'||edittype=='inport'}}" class="form editform edittype_{{edittype}}" ref="SrvTodo" id="todoForm" name="todoForm" target="jsoniframe" action="todo.{{edittype=='any'?'update':edittype}}.do" method="post">
	<div class="head"></div>
	<div class="body">
		<div class="content">
			<div lz:if="{{edittype!='detail'}}" class="prompt">
				温馨提示：请仔细填写待办事项相关信息，<span class="extrude">"*" 为必填选项。</span>
			</div>
			<br/>
			<lz:block lz:if="{{message}}">
			<br/>
			<center>
				<font color="red"><h4>{{message}}</h4></font>
			</center>
			<br/>
			</lz:block>
			<input type="hidden" value="{{complete}}" name="complete" id="complete" />
			<input type="hidden" value="{{ids}}" name="ids" id="ids" />
			<textarea name="PARAMS" id="PARAMS" style="display:none">{{PARAMS}}</textarea>
			
			
			<lz:block lz:if="{{inports}}">
			  <div class="line"></div>
			  <dl style="width:98%;">
			  	<dt>Excel文件:</dt>
			  	<dd>
			  		<input type="hidden" value="{{inports}}" name="inports" id="inports" />
			  		<input type="hidden" value="{{inport$}}" name="inport$" id="inport$" />
			  		<input name="file" name="file" type="file"/>
			  		<b>*</b>
			  		<div>
						请上传excel文件，表格列依次为：[{{inport$}}]，excel表格第一行为列名称，将不作为上传数据行
					</div>
			  	</dd>
			  </dl>
			  <div class="line"></div>
			</lz:block>
	{{lz.set("stId_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"stId"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"stId"))))}}
	{{lz.set("stId_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$stId}}
	<dl lz:if="{{stId_editable||stId_readonly}}" class="stId hidden " major  ref="stId">
		<dt>编　　号:</dt>
		<dd lz:if="{{stId_editable}}" input="hidden">
			<lz:block lz:if="{{srvTodo$stId}}">
				{{srvTodo$stId}}
			</lz:block>
			<lz:block lz:if="{{!srvTodo$stId}}">
			<input type="hidden" value="{{lz.htm(srvTodo.stId)}}" name="srvTodo.stId" id="stId" />
	 	 </lz:block>
	 	 
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{stId_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="stId">{{srvTodo.stId}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvTodo.stId$||srvTodo.stId)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$stId}}
	{{lz.set("stTitle_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"stTitle"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"stTitle"))))}}
	{{lz.set("stTitle_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$stTitle}}
	<dl lz:if="{{stTitle_editable||stTitle_readonly}}" class="stTitle  " major  ref="stTitle">
		<dt>待办标题:</dt>
		<dd lz:if="{{stTitle_editable}}" input="text">
			<lz:block lz:if="{{srvTodo$stTitle}}">
				{{srvTodo$stTitle}}
			</lz:block>
			<lz:block lz:if="{{!srvTodo$stTitle}}">
		 	<input type="text" class="input narrow"   name="srvTodo.stTitle" id="stTitle"  value="{{lz.htm(srvTodo.stTitle)}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请输入待办事项的待办标题</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{stTitle_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="stTitle">{{srvTodo.stTitle}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvTodo.stTitle$||srvTodo.stTitle)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$stTitle}}
	{{lz.set("stAlarmTime_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"stAlarmTime"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"stAlarmTime"))))}}
	{{lz.set("stAlarmTime_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$stAlarmTime}}
	<dl lz:if="{{stAlarmTime_editable||stAlarmTime_readonly}}" class="ribs stAlarmTime  " major  ref="stAlarmTime">
		<dt>设定提醒时间:</dt>
		<dd lz:if="{{stAlarmTime_editable}}" input="datetime">
			<lz:block lz:if="{{srvTodo$stAlarmTime}}">
				{{srvTodo$stAlarmTime}}
			</lz:block>
			<lz:block lz:if="{{!srvTodo$stAlarmTime}}">
		 	<input onchange="void(0);" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="datetime input narrow" maxlength="19" name="srvTodo.stAlarmTime" id="stAlarmTime"  value="{{srvTodo.stAlarmTime$}}"/>
	 	 </lz:block>
	 	 
	 	 <em>请选择待办事项的设定提醒时间</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{stAlarmTime_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="stAlarmTime">{{srvTodo.stAlarmTime}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvTodo.stAlarmTime$||srvTodo.stAlarmTime)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$stAlarmTime}}
	{{lz.set("stUser_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"stUser"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"stUser"))))}}
	{{lz.set("stUser_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$stUser}}
	<dl lz:if="{{stUser_editable||stUser_readonly}}" class="stUser  " major  ref="stUser">
		<dt>所属人员:</dt>
		<dd lz:if="{{stUser_editable}}" input="combox">
			<lz:block lz:if="{{srvTodo$stUser}}">
				{{srvTodo$stUser}}
			</lz:block>
			<lz:block lz:if="{{!srvTodo$stUser}}">
		 			<select class="combox narrow" action="/admin/permissions/user.query.do?size=255" id="stUser" name="srvTodo.stUser">
		 				<option selected="selected" value="{{lz.htm(srvTodo.stUser)}}">{{lz.htm(srvTodo.stUser$||srvTodo.stUser)}}</option>
		 			</select>
		 			<a class="lookup" href="javascript:void(0);" onclick="if($.trim($('#stUser').val())==''){return;};window.href('/admin/permissions/user.detail.do?key='+$('#stUser').val(),{ctrl:{editable:false}})"></a>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em></em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{stUser_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="stUser">{{srvTodo.stUser}}</textarea>
		 		<span>
		 	
			 <a href="javascript:void(0);" onclick="window.href('/admin/permissions/user.details.html?key=srvTodo.stUser}')">
			 {{lz.html(srvTodo.stUser$||srvTodo.stUser)}}</a>
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$stUser}}
	{{lz.set("stContent_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"stContent"))))&&true)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"stContent"))))}}
	{{lz.set("stContent_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$stContent}}
	<dl lz:if="{{stContent_editable||stContent_readonly}}" class="ribs stContent   wider" major  ref="stContent">
		<dt>待办内容:</dt>
		<dd lz:if="{{stContent_editable}}" input="textarea">
			<lz:block lz:if="{{srvTodo$stContent}}">
				{{srvTodo$stContent}}
			</lz:block>
			<lz:block lz:if="{{!srvTodo$stContent}}">
		 	<textarea class="input wide"  id="stContent" name="srvTodo.stContent" rows="5">{{srvTodo.stContent}}</textarea>
	 	 </lz:block>
	 	 
	 	 <em>请输入待办事项的待办内容</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{stContent_readonly}}">
		 	<div class="state-input wide">
		 		<span>
		 	
			 {{lz.html(srvTodo.stContent$||srvTodo.stContent)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$stContent}}
	{{lz.set("stUpdateTime_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"stUpdateTime"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"stUpdateTime"))))}}
	{{lz.set("stUpdateTime_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$stUpdateTime}}
	<dl lz:if="{{stUpdateTime_editable||stUpdateTime_readonly}}" class="stUpdateTime  " major  ref="stUpdateTime">
		<dt>修改时间:</dt>
		<dd lz:if="{{stUpdateTime_editable}}" input="datetime">
			<lz:block lz:if="{{srvTodo$stUpdateTime}}">
				{{srvTodo$stUpdateTime}}
			</lz:block>
			<lz:block lz:if="{{!srvTodo$stUpdateTime}}">
		 	<input onchange="void(0);" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="datetime input narrow" maxlength="19" name="srvTodo.stUpdateTime" id="stUpdateTime"  value="{{srvTodo.stUpdateTime$}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择待办事项的修改时间</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{stUpdateTime_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="stUpdateTime">{{srvTodo.stUpdateTime}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvTodo.stUpdateTime$||srvTodo.stUpdateTime)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$stUpdateTime}}
	{{lz.set("stAddTime_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"stAddTime"))))&&false)||(edittype=='update'&&false)||((edittype=='any')&&(lz.idin(fields,"stAddTime"))))}}
	{{lz.set("stAddTime_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$stAddTime}}
	<dl lz:if="{{stAddTime_editable||stAddTime_readonly}}" class="stAddTime  " major  ref="stAddTime">
		<dt>添加时间:</dt>
		<dd lz:if="{{stAddTime_editable}}" input="datetime">
			<lz:block lz:if="{{srvTodo$stAddTime}}">
				{{srvTodo$stAddTime}}
			</lz:block>
			<lz:block lz:if="{{!srvTodo$stAddTime}}">
		 	<input onchange="void(0);" onClick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss'})" type="text" class="datetime input narrow" maxlength="19" name="srvTodo.stAddTime" id="stAddTime"  value="{{srvTodo.stAddTime$}}"/>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择待办事项的添加时间</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{stAddTime_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="stAddTime">{{srvTodo.stAddTime}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvTodo.stAddTime$||srvTodo.stAddTime)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$stAddTime}}
	{{lz.set("stStatus_editable",((edittype=='insert'||(edittype=='inport' && (!lz.idin(inports,"stStatus"))))&&false)||(edittype=='update'&&true)||((edittype=='any')&&(lz.idin(fields,"stStatus"))))}}
	{{lz.set("stStatus_readonly",(edittype=='insert'&&false)||(edittype=='update'&&false)||(edittype=='detail'))}}
	
	{{before$stStatus}}
	<dl lz:if="{{stStatus_editable||stStatus_readonly}}" class="stStatus  " major  ref="stStatus">
		<dt>状　　态:</dt>
		<dd lz:if="{{stStatus_editable}}" input="select">
			<lz:block lz:if="{{srvTodo$stStatus}}">
				{{srvTodo$stStatus}}
			</lz:block>
			<lz:block lz:if="{{!srvTodo$stStatus}}">
		 	<select class="narrow" id="stStatus" name="srvTodo.stStatus">
		 		<option value="">请选择</option>
				<option value="0" selected='{{srvTodo.stStatus=="0"?"selected":""}}'>待处理</option>
				<option value="1" selected='{{srvTodo.stStatus=="1"?"selected":""}}'>提醒报警</option>
				<option value="2" selected='{{srvTodo.stStatus=="2"?"selected":""}}'>已完成</option>
		 	</select>
	 	 </lz:block>
	 	 <b>*</b>
	 	 <em>请选择待办事项的状态</em> 
	 	 <a class="mui-navigate-right"></a>
		</dd>
		<dd lz:if="{{stStatus_readonly}}">
		 	<div class="state-input narrow">
		 		<textarea class=""  style="display:none;" id="stStatus">{{srvTodo.stStatus}}</textarea>
		 		<span>
		 	
			 {{lz.html(srvTodo.stStatus$||srvTodo.stStatus)}}
	 	 		</span>
	 	 	</div>
		</dd>
	</dl>
	{{after$stStatus}}
			
			
			<div class="line">
				<center lz:if="{{edittype=='insert'}}">
					<a onclick="$('.ribs').show();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:inline;padding: 0px 15px;">点击展开更多编辑项</a>
					<a onclick="$('.ribs').hide();window.fireResize();$('.ribs-handle').toggle();" href="javascript:void(0);" class="state-content ribs-handle" style="display:none;padding: 0px 15px;">点击收起更多编辑项</a>
				</center>
			</div>
			<center class="buttons">
				<input type="hidden" value="{{srvTodo.stId}}" name="srvTodo.stId" id="stId" />
			
			<lz:block lz:if="{{edittype=='insert'||edittype=='update'||edittype=='any'||edittype=='inport'}}">
				<button class="button" type="submit">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					保存&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
			
			<lz:block lz:if="{{edittype=='detail'}}">
				<button lz:if="{{canEdit}}" type="button" class="button" onclick='window.location.href="/admin/systematic/todo.edit.html?edittype=update&id={{srvTodo.id}}"'>
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-tick.png"/>
					<span class="iconB iconfont icon-weibiaoti8"></span>
					修改&nbsp;&nbsp;</button>
				<button lz:if="{{canDel}}" type="button" class="button" onclick="deleteTodo('{{srvTodo.id}}','{{srvTodo.stTitle}}')">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					删除&nbsp;&nbsp;</button>
				<button title="不保存数据,关闭窗口,不刷新原列表" class="button" onclick="cancel();" type="button">
					&nbsp;<img class="iconA" align="absmiddle" width="20" src="/admin/images/icons/Badge-multiply.png"/>
					<span class="iconB iconfont icon-icon11"></span>
					关闭&nbsp;&nbsp;</button>
			</lz:block>
					
			</center>
			<br/>

		</div>
	</div>
	<div class="foot"></div>		
</form>

 


<!------------------------VIEW_HTML_BOTTOM------------------------>
<!------------------------VIEW_HTML_BOTTOM------------------------>


</body>

<!------------------------VIEW_HTML_FOOTER------------------------>
<!------------------------VIEW_HTML_FOOTER------------------------>
<script>
	
	$(function(){
		if(parent.setit){
			parent.setit("/admin/systematic/todo.edit.html",document.title,"/admin//images/icons/200882564225077801.png");
		}
	});
	
	function cancel(){
		if(parent.closeHref){
			parent.closeHref("/admin/systematic/todo.edit.html");
		}else{
			$.closeModalDialog();
		}
	}


	/**
	* 删除待办事项
	**/
	function deleteTodo(id,flag)
	{
		var dialog=top.$.dialog({
				html:"<span style='white-space:nowrap;'>确定要删除当前数据吗？</span>",
				title:"删除待办事项",
				modal: true,			
				onOk:function(){
					dialog.closeDialog();
					var url = "/admin/systematic/todo.delete.do";
					var params = {id:id};
					var protocol = $.getAjax(url,params);
					if(protocol.message){
						top.$.toast(protocol.message);
					}
					if(protocol.success){
						caller.location.href=caller.location.href;		
					}
				}
		 });	
	}
</script>
</html>